import json
import os
from icecream import ic


def traverse_json_files(folder):
    for root, dirs, files in os.walk(folder):
        ic(root, dirs)

        for file in files:
            if file.endswith(".json"):
                file_path = os.path.join(root, file)
                with open(file_path, "r", encoding='utf-8') as json_file:
                    try:
                        data = json.load(json_file)
                        # 在这里处理 JSON 数据
                        print(f"Found JSON file: {file_path}")
                        print(data)
                    except json.JSONDecodeError as e:
                        print(f"Error decoding JSON in {file_path}: {e}")


def main():
    pass


if __name__ == '__main__':
    main()
